import logging
import time

class Config():

    logger = logging.getLogger("mylogger")

    logger.setLevel(logging.DEBUG)
    if not logger.handlers:
        formatter = logging.Formatter('%(asctime)s | %(levelname)s -> %(message)s')

        # file_handler = logging.FileHandler(filename=r'{}'.format(time.strftime("%Y-%m-%d%H:%M:%S")))
        fh = logging.FileHandler(filename=r"log\{}".format(time.strftime("%Y-%m-%d %H-%M-%S")), encoding='utf-8')
        # stream_handler = logging.StreamHandler()
        # filename="{}.log".format(time.strftime("%Y-%m-%d %H:%M:%S"))
        fh.setFormatter(formatter)
        fh.setLevel(logging.DEBUG)

        logger.addHandler(fh)
        # logger.addHandler(stream_handler)

    def get_config(self):
        return self.logger